#include "..\CookHeader.h"

int SIZE;
Array <string> stack;
int top = -1;

bool isStackEmpty() {  
	if (top == -1)
		return true;
	else
		return false;
}

bool isStackFull() {  
	if (top >= SIZE - 1)
		return true;
	else
		return false;
}

void push(string data) {   
	if (isStackFull()) {
		return;
	}
	top++;
	stack[top] = data;
}

string pop() {   
	if (isStackEmpty()) {
		return "None";
	}
	string data = stack[top];
	stack[top] = "None";
	top--;
	return data;
}

int main() {
	SIZE = 10;
	for (int i = 0; i < SIZE; i++)
		stack.push_back("None");

	Array <string> stoneAry = { "", "Ķ", "ʷ", "", "", "Ȳ" };
	randomInit(1, len(stoneAry)-1);
	for (int i = 0; i < len(stoneAry) * 100; i++) {
		int n1 = cookRandom(gen);
		int n2 = cookRandom(gen);
		swap(stoneAry[n1], stoneAry[n2]);
	}

	print("   : ");
	for (int i = 0; i < len(stoneAry); i++) {
		string stone = stoneAry[i];
		push(stone);
		print(stone + "-->");
	}
	println("");

	print("츮   : ");
	while (true) {
		string stone = pop();
		if (stone == "None")
			break;
		print(stone + "-->");
	}
	println("츮");	
}